package com.miyake.dsp.otdr.ui;

import java.awt.FlowLayout;
import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JFrame;

public class OtdrSettingFrame extends JFrame {
	/**
	 * 
	 */
	private static final long serialVersionUID = -4808780318043661920L;
	AbstractOtdrPanel panel;
	
	public OtdrSettingFrame(final AbstractOtdrPanel panel) {
		this.setTitle("OTDR Setting");
		this.panel = panel;
		this.setSize(panel.getWidth(), panel.getHeight()+50);
		this.getContentPane().setLayout(new FlowLayout());
		this.getContentPane().add(panel);
		JButton close = new JButton("Close");
		close.addActionListener(new ActionListener() {

			@Override
			public void actionPerformed(ActionEvent arg0) {
				panel.apply();
				setVisible(false);
			}
			
		});
		this.getContentPane().add(close);
	}
}
